home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / phit.swf / scripts / __Packages / CMenuPickLevel.as < prev    next >
Encoding:
Text File  |  2007-07-13  |  1.8 KB  |  49 lines

  1. class CMenuPickLevel extends CMovieClipFresh
  2. {
  3.    var _buttonBack;
  4.    var _buttonJump;
  5.    var _skipLevelButtonHost;
  6.    function CMenuPickLevel()
  7.    {
  8.       super();
  9.       this.stop();
  10.    }
  11.    function FirstFrameInitialize()
  12.    {
  13.       this._buttonBack.Initialize("Back",this.OnBack);
  14.       this._buttonJump.Initialize("Play",this.OnJump);
  15.       this._buttonJump.SetEnabled(false);
  16.       var _loc10_ = 350;
  17.       var _loc3_ = _loc10_ / 10;
  18.       var _loc2_ = 1;
  19.       while(_loc2_ <= 10)
  20.       {
  21.          this._skipLevelButtonHost.attachMovie("Skip Level Button","_button" + this._skipLevelButtonHost.getNextHighestDepth(),this._skipLevelButtonHost.getNextHighestDepth(),{_iLevel:_loc2_,_x:_loc3_ * (_loc2_ - 1),_y:0,_xscale:60,_yscale:60});
  22.          _loc2_ = _loc2_ + 1;
  23.       }
  24.       var _loc9_ = 60;
  25.       _loc2_ = 1;
  26.       this._skipLevelButtonHost.attachMovie("Skip Level Button","_button" + this._skipLevelButtonHost.getNextHighestDepth(),this._skipLevelButtonHost.getNextHighestDepth(),{_iLevel:15,_x:_loc3_ * (_loc2_ - 1),_y:_loc9_,_xscale:60,_yscale:60});
  27.       _loc2_ = 2;
  28.       while(_loc2_ <= 10)
  29.       {
  30.          this._skipLevelButtonHost.attachMovie("Skip Level Button","_button" + this._skipLevelButtonHost.getNextHighestDepth(),this._skipLevelButtonHost.getNextHighestDepth(),{_iLevel:_loc2_ * 10,_x:_loc3_ * (_loc2_ - 1),_y:_loc9_,_xscale:60,_yscale:60});
  31.          _loc2_ = _loc2_ + 1;
  32.       }
  33.    }
  34.    function onEnterFrame()
  35.    {
  36.       super.onEnterFrame();
  37.       this._buttonJump.SetEnabled(int(_root._strJumpLevel) >= 1);
  38.    }
  39.    function OnBack()
  40.    {
  41.       _root._mainMenu.gotoAndPlay("from pick level");
  42.    }
  43.    function OnJump()
  44.    {
  45.       _root._iStartLevel = int(_root._strJumpLevel) - 1;
  46.       _root._mainMenu.gotoAndPlay("dismiss pick");
  47.    }
  48. }
  49.